Function.prototype.myapply = function (thisArg, argArray) {
  if (thisArg === null || undefined) {
    thisArg = window || globalThis
  }
  if (typeof this !== 'function') {
    throw new TypeError('Error')
  }
  let key = Symbol('key')
  thisArg[key] = this
  let res = thisArg[key](...argArray)
  delete thisArg[key]
  return res
}
// 测试
const o = {
  name: '白雨杰',
  age: 1
}
function say(job, address) {
  console.log(this.name, this.age, job, address)
}
say.myapply(o, ['前端', '北京'])
